package com.example.shysx11.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.shysx11.dao.IUserDao;
import com.example.shysx11.pojo.User;
import com.example.shysx11.vos.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserDao dao;

    @Override
    public ResultVo getUsers(){
        List<User> users=dao.selectList(null);
        return  ResultVo.success("success get message",users);
    }
    @Override
    public  ResultVo getOne(){
        QueryWrapper<User> qw=new QueryWrapper<>();
        qw.eq("username","admin").eq("password","123456");
            User user =dao.selectOne(qw);
        return ResultVo.success("one success",user);

    }


}
